package com.vchecker.iobd_checker.model;

import android.os.Bundle;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by Yipb on 16-4-20.
 */
public class CommDefine {
    public static final int CMD_OK          = 0;
    public static final int CMD_OVERTIME    = -1;
    public static final int CMD_REJECT      = -2;

    public static final int MESSAGE_CLIENT = 0;
    public static final int MESSAGE_CLIENT_ADD_LOG                       = 1;
    public static final int MESSAGE_CLIENT_SEARCH_FINISH                = 2;
    public static final int MESSAGE_CLIENT_PAIR_FINISH                  = 3;
    public static final int MESSAGE_CLIENT_PAIR_CANCEL                  = 4;

    public static final int MESSAGE_SEARCH = 1;
    public static final int MESSAGE_SEARCH_FOUND                        = 101;

    public static final int MESSAGE_UPGRAD = 2;
    public static final int MESSAGE_UPGRAD_CONNECT_FAIL                  = 200;
    public static final int MESSAGE_UPGRAD_START                        = 201;
    public static final int MESSAGE_UPGRAD_UPDATEING                       = 202;
    public static final int MESSAGE_UPGRAD_SUCCESS                       = 203;
    public static final int MESSAGE_UPGRAD_FAILURE                       = 204;
    public static final int MESSAGE_UPGRAD_ERR_CMD                       = 205;//发送命令错误
    public static final int MESSAGE_UPGRAD_ERR_VER                       = 206;
    public static final int MESSAGE_UPGRAD_ERR_LAN                       = 207;
    public static final int MESSAGE_UPGRAD_NO_NEW                       = 208;

    public static void addLog(String tag,String text){
        Bundle dataOk = new Bundle();
        dataOk.putString("TAG",tag);
        dataOk.putString("TEXT",text);
        EventBus.getDefault()
                .post(new CommEvent(
                        CommDefine.MESSAGE_CLIENT,
                        CommDefine.MESSAGE_CLIENT_ADD_LOG,
                        dataOk));
    }
}
